<template>
  <div class="app flex column grow">
    <div class="messageBox">
      <Advisor>
        <template slot="title">
          <div class="title flex shrink">
            <span :class="'bhead icon' + version">
              {{ version == 4 ? "专属投顾" : "尊享投顾" }}
            </span>
            <span
              class="titleTxt"
              title="投资顾问意见仅做参考，不作为买卖建议。股市有风险，投资需谨慎！"
              >投资顾问意见仅做参考，不作为买卖建议。股市有风险，投资需谨慎！</span
            >
          </div>
        </template>
      </Advisor>
    </div>
  </div>
</template>
<script>
import Advisor from "./advisor";
import * as fn from "../script/utils";
import { userClickUpdate } from "../api/api";
import behavior from "../script/behavior";
const { version, token } = fn.getUrlParams();
const userData = { ...behavior };

export default {
  components: { Advisor },
  data() {
    return {
      version: version,
    };
  },
  mounted() {
    this.userClick();
  },
  methods: {
    async userClick() {
      let openTime = localStorage.getItem("openTime");
      if (openTime == null) {
        localStorage.setItem("openTime", "1");
      } else {
        localStorage.setItem("openTime", ++openTime);
      }
      userData.user.token = token;
      userData.event[0].eventSubject.extend.openTime = openTime;
      if (!fn.isOneMinu()) return;
      await userClickUpdate(userData).then((back) => {
        if (back.status == 1) {
          let data = back.data;
        }
      });
    },
  },
};
</script>

<style lang="scss">
body {
  background: url($PIC_URL + "/tlbypcWeb/advisor/bg.jpg") no-repeat center;
  background-size: cover;
}
._stockCode {
  color: #2e76d8;
  cursor: pointer;
}
</style>
<style lang="scss">
@import "../style/var.scss";
.app {
  align-items: center;
  justify-content: center;
  .messageBox {
    width: 80%;
    min-width: 700px;
    max-width: 1150px;
    min-height: 660px;
    height: 88%;
    background: #fff;
    .title {
      height: 52px;
      //   line-height: 52px;
      align-items: center;
      color: #e1e1e1;
      font-weight: 400;
      background: #393a3e;
      .bhead {
        display: inline-block;
        width: 116px;
        height: 43px;
        line-height: 43px;
        font-size: 20px;
        padding-left: 12px;
        box-sizing: border-box;
        margin-right: 22px;
        font-weight: bold;
        &.icon4 {
          background: url($PIC_URL + "/tlbypcWeb/advisor/clzb.png") no-repeat
            left center;
          color: #36374e;
        }
        &.icon5 {
          color: #fbda98;
          background: url($PIC_URL + "/tlbypcWeb/advisor/zxtg.png") no-repeat
            left center;
        }
      }

      .titleTxt {
        letter-spacing: 1px;
        font-size: 13px;
        width: 73%;
        margin-right: 40px;
      }
    }
    @include theme1;
  }
}
</style>
